#include <stdio.h>
#include <stdlib.h>
#include "queue.h"

typedef struct {
	int iden;
	char *string;
} object_t;

void* create_object (int iden_s, char *string_s) {
	object_t *o = (object_t*) malloc (sizeof (object_t));
	o->iden = iden_s;
	o->string = string_s;
	return (void*) o;
}

int main (void) {
	int i;
	struct Queue *q = NULL;
	void *objects[4] = { NULL };
	object_t *object = NULL;
	char *strings[] = {
			"Hello, World!",
			"The quick brown fox jumps over the lazy dog.",
			"A random string in a list of others.",
			"And lo, here quaint it was, unbenownst to those who sought to destroy."
	};
	for (i = 0; i < 4; i++)
		objects[i] = create_object (i, strings[i]);

	q = (struct Queue*) malloc (sizeof (struct Queue));
	initQueue(q);
	for (i = 0; i < 4; i++)
		q->enqueue(objects[i], q);
	for (i = 0; i < 4; i++) {
		object = q->dequeue(q);
		printf("[%d]: %s\n", object->iden, object->string);
	}

	return EXIT_SUCCESS;
}
